"use strict";

$(function () {
    $.ajax({
        url: "/wzmanage/user/info",
        type: "post",
        contentType: "application/json;charset=utf-8",
        success: function success(data) {
            var ulist = data.user,
                rlist = data.roleList,
                reslist = data.resList;

            var html = "\n                <tr>\n                    <td>\u59D3\u540D\uFF1A</td><td>" + ulist.name + "</td>\n                    <td>\u624B\u673A\u53F7\uFF1A</td><td>" + ulist.phone + "</td>\n                    <td>\u804C\u4F4D\uFF1A</td><td>" + ulist.job + "</td>\n                </tr>\n                <tr>\n                    <td>\u6635\u79F0\uFF1A</td><td>" + ulist.nickName + "</td>\n                    <td>\u5E74\u9F84\uFF1A</td><td>" + ulist.age + "</td>\n                    <td>\u5165\u804C\u65E5\u671F\uFF1A</td><td>" + ulist.createTime.slice(0, 10) + "</td>\n                </tr>\n                 <tr>\n                    <td>QQ\uFF1A</td><td>" + ulist.qq + "</td>\n                     <td>\u6027\u522B\uFF1A</td><td>" + ulist.sex + "</td>\n                    <td>\u5458\u5DE5\u7F16\u53F7\uFF1A</td><td>" + ulist.postId + "</td>\n                </tr>\n                 <tr>\n                    <td>\u5EA7\u673A\uFF1A</td><td>" + (ulist.fixPhone ? ulist.fixPhone : '') + "</td>\n                    <td>E-Mail\uFF1A</td><td>" + ulist.mail + "</td>\n                    <td>\u5458\u5DE5\u6240\u5728\u7EC4\uFF1A</td><td>" + ulist.usersGroup + "</td>\n                </tr>\n            ";
            for (var i = 0; i < rlist.length; i++) {
                html += "\n                    <tr>\n                        <td>\u89D2\u8272\u540D\uFF1A</td>\n                        <td>" + rlist[i].name + "</td>\n                        <td colspan=\"4\">" + rlist[i].description + "</td>\n                    </tr>\n                ";
            }
            for (var i = 0; i < reslist.length; i++) {
                html += "\n                    <tr>\n                        <td>\u6743\u9650\u540D\uFF1A</td>\n                        <td>" + reslist[i].name + "</td>\n                        <td colspan=\"2\">" + reslist[i].url + "</td>\n                        <td colspan=\"2\">" + reslist[i].description + "</td>\n                    </tr>\n                ";
            }
            $(".user-list tbody").html(html);
            console.log(data);
        }
    });
});